package routes

import (
	"github.com/gin-gonic/gin"
	"iot-base/auth/admin/handler/manage"
	"iot-base/auth/config"
	auth2 "iot-base/auth/middleware/auth"
)

func MangeRouter(g *gin.Engine) {
	routePath := g.Group(config.Conf.Server.Prefix + "/" + config.Conf.Server.Version + "/mg").Use(auth2.JWTAuth())
	//添加设备
	routePath.GET("/thingList", manage.QueryThingList)  // 设备列表
	routePath.GET("/modelList", manage.GetThingSelect)  // 下拉选项
	routePath.GET("/protocol", manage.GetModelProtocol) // 获取物模型协议
	routePath.GET("/thingParam", manage.GetThingParam)  // 获取设备参数
	routePath.POST("/thing", manage.AddThing)           // 添加设备
	routePath.PUT("/thing", manage.ModifyThing)
	routePath.DELETE("/thing", manage.DelThing)
	//添加站点
	routePath.GET("/stationModel", manage.StationModel)
	routePath.GET("/areas", manage.GetAreas)
	routePath.POST("/station", manage.AddStation)
	routePath.GET("/station", manage.GetStation)
	routePath.PUT("/station", manage.ModifyStation)
	routePath.DELETE("/station", manage.DelStation)
}
